package net.huashitong.ssydt.provider.pk.controller;


import net.huashitong.ssydt.pk.entity.SsPkGameRule;
import net.huashitong.ssydt.provider.pk.service.PkService;
import net.huashitong.ssydt.provider.pk.service.SsPkGameRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * pk挑战配置
 * @author <a href="mailto:yhy23456@163.com">huiyang.yu</a>
 * @since 2017.12.22
 */
@RestController
@RequestMapping("/pk/game/rule")
public class SsPkGameRuleController {

    private SsPkGameRuleService ssPkGameRuleService;

    private PkService pkService;

    @Autowired
    public SsPkGameRuleController(SsPkGameRuleService ssPkGameRuleService, PkService pkService) {
        this.ssPkGameRuleService = ssPkGameRuleService;
        this.pkService = pkService;
    }

    @GetMapping("/{id}")
    public SsPkGameRule selectByPrimaryKey(@PathVariable Long id) {
        return ssPkGameRuleService.selectByPrimaryKey(id);
    }

    @PutMapping("/selective")
    public int updateByPrimaryKeySelective(@RequestBody SsPkGameRule record) {
        return ssPkGameRuleService.updateByPrimaryKeySelective(record);
    }

    @PutMapping("/update/this")
    public int updateThis(@RequestBody SsPkGameRule record) {
        return pkService.updateThis(record);
    }

}
